26 #ifndef MLN_ACCU_STAT_MIN_H_HH
27 # define MLN_ACCU_STAT_MIN_H_HH
33 # include <mln/accu/internal/base.hh>
34 # include <mln/accu/histo.hh>
35 # include <mln/value/set.hh>
36 # include <mln/util/pix.hh>
45 template <
typename V>
struct min_h;
56 struct accumulator_< accu::stat::min_h<V> >
58 typedef accumulator::has_untake::yes
has_untake;
60 typedef accumulator::has_stop::no
has_stop;
61 typedef accumulator::when_pix::use_v
when_pix;
115 unsigned card()
const {
return h_.sum(); }
146 template <
typename I>
struct min_h< util::pix<I> >;
149 # ifndef MLN_INCLUDE_ONLY
151 template <typename V>
160 template <
typename V>
167 this->take_as_init_(t);
178 template <
typename V>
185 for (
unsigned i = 0; i < i_; ++i)
191 template <
typename V>
196 mln_precondition(h_(t) != 0);
205 mln_invariant(sum_ >= 1);
210 if (t == t_ && h_[i_] == 0)
214 template <
typename V>
227 template <
typename V>
242 template <
typename V>
253 template <
typename V>
260 i_ = mln_max(argument);
265 template <
typename V>
277 template <
typename V>
279 const typename min_h<V>::argument&
287 template <
typename V>
289 const accu::histo<V>&
295 template <
typename V>
304 template <
typename V>
309 std::cout <<
"h={" << h_ <<
"} ";
310 std::cout <<
"sum=" << sum_ <<
' '
311 <<
"valid=" << valid_ <<
' '
313 <<
"t=" << t_ << std::endl;
316 template <
typename V>
318 std::ostream& operator<<(std::ostream& ostr, const min_h<V>& m)
320 return ostr << m.to_result();
323 # endif // ! MLN_INCLUDE_ONLY
332 #endif // ! MLN_ACCU_STAT_MIN_H_HH