@@ -22,6 +22,9 @@ import ArrayFire.FFI
2222import ArrayFire.Exception
2323
2424-- | Construct 'Features'
25+ --
26+ -- >>> features = createFeatures (createFeatures 10)
27+ --
2528createFeatures
2629 :: Int
2730 -> Features
@@ -35,42 +38,81 @@ createFeatures (fromIntegral -> n) =
3538 pure (Features fptr)
3639
3740-- | Retain 'Features'
41+ --
42+ -- >>> features = retainFeatures (createFeatures 10)
43+ --
3844retainFeatures
3945 :: Features
4046 -> Features
4147retainFeatures = (`op1f` af_retain_features)
4248
4349-- | Get number of 'Feature's
50+ --
51+ -- link
52+ --
53+ -- >>> getFeaturesNum (createFeatures 10)
54+ -- 10
55+ --
4456getFeaturesNum
4557 :: Features
4658 -> Int
4759getFeaturesNum = fromIntegral . (`infoFromFeatures` af_get_features_num)
4860
4961-- | Get 'Feature' X-position
62+ --
63+ -- >>> getFeaturesXPos (createFeatures 10)
64+ -- ArrayFire Array
65+ -- [10 1 1 1]
66+ -- 0.0000 0.0000 0.0000 0.0000 0.0000 2.1250 0.0000 2.2500 0.0000 0.0000
67+ --
5068getFeaturesXPos
5169 :: Features
5270 -> Array a
5371getFeaturesXPos = (`featuresToArray` af_get_features_xpos)
5472
5573-- | Get 'Feature' Y-position
74+ --
75+ -- >>> getFeaturesYPos (createFeatures 10)
76+ -- ArrayFire Array
77+ -- [10 1 1 1]
78+ -- 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
79+ --
5680getFeaturesYPos
5781 :: Features
5882 -> Array a
5983getFeaturesYPos = (`featuresToArray` af_get_features_ypos)
6084
6185-- | Get 'Feature' Score
86+ --
87+ -- >>> getFeaturesScore (createFeatures 10)
88+ -- ArrayFire Array
89+ -- [10 1 1 1]
90+ -- 0.0000 1.8750 0.0000 2.0000 0.0000 2.1250 0.0000 2.2500 nan nan
91+ --
6292getFeaturesScore
6393 :: Features
6494 -> Array a
6595getFeaturesScore = (`featuresToArray` af_get_features_score)
6696
6797-- | Get 'Feature' orientation
98+ --
99+ -- >>> getFeaturesOrientation (createFeatures 10)
100+ -- ArrayFire Array
101+ -- [10 1 1 1]
102+ -- 0.0000 1.8750 0.0000 2.0000 0.0000 2.1250 0.0000 2.2500 0.0000 0.0000
103+ --
68104getFeaturesOrientation
69105 :: Features
70106 -> Array a
71107getFeaturesOrientation = (`featuresToArray` af_get_features_orientation)
72108
73109-- | Get 'Feature' size
110+ --
111+ -- >>> getFeaturesSize (createFeatures 10)
112+ -- ArrayFire Array
113+ -- [10 1 1 1]
114+ -- nan nan nan nan nan nan nan nan nan nan
115+ --
74116getFeaturesSize
75117 :: Features
76118 -> Array a
0 commit comments