MCPcopy Create free account
hub / github.com/BirolLab/abyss / firstLocalMinimum

Method firstLocalMinimum

Common/Histogram.h:192–209  ·  view source on GitHub ↗

Return the first local minimum or zero if a minimum is not * found. */

Source from the content-addressed store, hash-verified

190 /** Return the first local minimum or zero if a minimum is not
191 * found. */
192 T firstLocalMinimum() const
193 {
194 const unsigned SMOOTHING = 4;
195 assert(!empty());
196 Map::const_iterator minimum = m_map.begin();
197 size_type count = 0;
198 for (Map::const_iterator it = m_map.begin();
199 it != m_map.end(); ++it) {
200 if (it->second <= minimum->second) {
201 minimum = it;
202 count = 0;
203 } else if (++count >= SMOOTHING)
204 break;
205 }
206 if (minimum->first == maximum())
207 return 0;
208 return minimum->first;
209 }
210
211 void eraseNegative()
212 {

Callers 1

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected