@@ -74,10 +74,8 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
74
74
class ReduceOpBase
75
75
{
76
76
public:
77
- bool hasSIMD = false ;
78
- ReduceOpBase () {}
79
- virtual ~ReduceOpBase () {};
80
- virtual float apply (const float *, const float *, const float ikarea = 1 .0f ) = 0;
77
+ // bool hasSIMD = false;
78
+ // float apply(const float*, const float*, const float ikarea = 1.0f);
81
79
};
82
80
83
81
// type == MIN
@@ -87,7 +85,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
87
85
bool hasSIMD = true ;
88
86
ReduceOpMIN () {}
89
87
90
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
88
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
91
89
{
92
90
return std::accumulate (first, last, FLT_MAX,
93
91
[](float a, float b)
@@ -104,7 +102,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
104
102
bool hasSIMD = true ;
105
103
ReduceOpMAX () {}
106
104
107
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
105
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
108
106
{
109
107
return std::accumulate (first, last, -FLT_MAX,
110
108
[](float a, float b)
@@ -121,7 +119,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
121
119
bool hasSIMD = true ;
122
120
ReduceOpSUM () {}
123
121
124
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
122
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
125
123
{
126
124
return std::accumulate (first, last, 0 .f );
127
125
}
@@ -134,7 +132,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
134
132
bool hasSIMD = true ;
135
133
ReduceOpAVE () {}
136
134
137
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
135
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
138
136
{
139
137
float output = std::accumulate (first, last, 0 .f );
140
138
return output * ikarea;
@@ -148,7 +146,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
148
146
bool hasSIMD = true ;
149
147
ReduceOpSUM_SQUARE (){}
150
148
151
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
149
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
152
150
{
153
151
return std::accumulate (first, last, 0 .f ,
154
152
[](float a, float b)
@@ -165,7 +163,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
165
163
bool hasSIMD = true ;
166
164
ReduceOpL1 (){}
167
165
168
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
166
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
169
167
{
170
168
return std::accumulate (first, last, 0 .f ,
171
169
[](float a, float b)
@@ -182,7 +180,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
182
180
bool hasSIMD = true ;
183
181
ReduceOpL2 (){}
184
182
185
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
183
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
186
184
{
187
185
float output = std::accumulate (first, last, 0 .f ,
188
186
[](float a, float b)
@@ -200,7 +198,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
200
198
bool hasSIMD = true ;
201
199
ReduceOpPROD (){}
202
200
203
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
201
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
204
202
{
205
203
return std::accumulate (first, last, 1 .0f , std::multiplies<float >());
206
204
}
@@ -213,7 +211,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
213
211
bool hasSIMD = false ;
214
212
ReduceOpLOG_SUM (){}
215
213
216
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
214
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
217
215
{
218
216
float output = std::accumulate (first, last, 0 .0f );
219
217
return std::log (output);
@@ -226,7 +224,7 @@ class ReduceLayerImpl CV_FINAL : public ReduceLayer
226
224
public:
227
225
ReduceOpLOG_SUM_EXP (){}
228
226
229
- float apply (const float * first, const float * last, const float ikarea = 1 .0f ) override
227
+ float apply (const float * first, const float * last, const float ikarea = 1 .0f )
230
228
{
231
229
float output = std::accumulate (first, last, 0 .0f ,
232
230
[](float a, float b)
0 commit comments