From d14283e619f9884e21588d2579cc6a63df5a581a Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 29 Feb 2008 12:15:06 +0000 Subject: [PATCH] added maxcount --- vcg/math/histogram.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vcg/math/histogram.h b/vcg/math/histogram.h index b8b29195..b27b3451 100644 --- a/vcg/math/histogram.h +++ b/vcg/math/histogram.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.16 2006/11/28 21:29:21 cignoni +Re added typedef Histogramf and Histogramd + Revision 1.15 2006/11/28 09:47:42 corsini add documentation fix typo @@ -152,6 +155,7 @@ public: */ void Add(ScalarType v); + int MaxCount() const; /** * Returns the value corresponding to a given percentile of the data. * @@ -263,6 +267,14 @@ void Histogram::FileWrite(const std::string &filename) } +template +int Histogram::MaxCount() const +{ + return *(std::max_element(H.begin(),H.end())); +} + + + template ScalarType Histogram::Percentile(ScalarType frac) const {