added maxcount

This commit is contained in:
Paolo Cignoni 2008-02-29 12:15:06 +00:00
parent 97c0bd9ffa
commit d14283e619
1 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $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 Revision 1.15 2006/11/28 09:47:42 corsini
add documentation add documentation
fix typo fix typo
@ -152,6 +155,7 @@ public:
*/ */
void Add(ScalarType v); void Add(ScalarType v);
int MaxCount() const;
/** /**
* Returns the value corresponding to a given percentile of the data. * Returns the value corresponding to a given percentile of the data.
* *
@ -263,6 +267,14 @@ void Histogram<ScalarType>::FileWrite(const std::string &filename)
} }
template <class ScalarType>
int Histogram<ScalarType>::MaxCount() const
{
return *(std::max_element(H.begin(),H.end()));
}
template <class ScalarType> template <class ScalarType>
ScalarType Histogram<ScalarType>::Percentile(ScalarType frac) const ScalarType Histogram<ScalarType>::Percentile(ScalarType frac) const
{ {