@@ -22,6 +22,9 @@ import ArrayFire.FFI
22
22
import ArrayFire.Exception
23
23
24
24
-- | Construct 'Features'
25
+ --
26
+ -- >>> features = createFeatures (createFeatures 10)
27
+ --
25
28
createFeatures
26
29
:: Int
27
30
-> Features
@@ -35,42 +38,81 @@ createFeatures (fromIntegral -> n) =
35
38
pure (Features fptr)
36
39
37
40
-- | Retain 'Features'
41
+ --
42
+ -- >>> features = retainFeatures (createFeatures 10)
43
+ --
38
44
retainFeatures
39
45
:: Features
40
46
-> Features
41
47
retainFeatures = (`op1f` af_retain_features)
42
48
43
49
-- | Get number of 'Feature's
50
+ --
51
+ -- link
52
+ --
53
+ -- >>> getFeaturesNum (createFeatures 10)
54
+ -- 10
55
+ --
44
56
getFeaturesNum
45
57
:: Features
46
58
-> Int
47
59
getFeaturesNum = fromIntegral . (`infoFromFeatures` af_get_features_num)
48
60
49
61
-- | 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
+ --
50
68
getFeaturesXPos
51
69
:: Features
52
70
-> Array a
53
71
getFeaturesXPos = (`featuresToArray` af_get_features_xpos)
54
72
55
73
-- | 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
+ --
56
80
getFeaturesYPos
57
81
:: Features
58
82
-> Array a
59
83
getFeaturesYPos = (`featuresToArray` af_get_features_ypos)
60
84
61
85
-- | 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
+ --
62
92
getFeaturesScore
63
93
:: Features
64
94
-> Array a
65
95
getFeaturesScore = (`featuresToArray` af_get_features_score)
66
96
67
97
-- | 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
+ --
68
104
getFeaturesOrientation
69
105
:: Features
70
106
-> Array a
71
107
getFeaturesOrientation = (`featuresToArray` af_get_features_orientation)
72
108
73
109
-- | 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
+ --
74
116
getFeaturesSize
75
117
:: Features
76
118
-> Array a
0 commit comments