\hypertarget{a00118}{
\section{mln::accu::stat::mean$<$ T, S, M $>$ Struct Template Reference}
\label{d8/d87/a00118}\index{mln::accu::stat::mean@{mln::accu::stat::mean}}
}


Generic mean accumulator class.  




{\ttfamily \#include $<$mean.hh$>$}



Inherits base$<$ M, mean$<$ T, S, M $>$ $>$.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{a00068}{accu::math::count}$<$ T $>$::result \hyperlink{a00118_a6f640cd2c45cea7827bfc43a1fdc55f3}{count} () const 
\begin{DoxyCompactList}\small\item\em Get the cardinality. \item\end{DoxyCompactList}\item 
bool \hyperlink{a00118_af58bf0c7cdb1bfcd7d2e20a8a8643205}{is\_\-valid} () const 
\begin{DoxyCompactList}\small\item\em Check whether this accu is able to return a result. \item\end{DoxyCompactList}\item 
\hyperlink{a00070}{accu::math::sum}$<$ T $>$::result \hyperlink{a00118_a5c53a6ddd8db6a51e77bbf964b80d60a}{sum} () const 
\begin{DoxyCompactList}\small\item\em Get the sum of values. \item\end{DoxyCompactList}\item 
void \hyperlink{a00026_a745794a4ef16926d3c09ebbaa8b6b557}{take\_\-as\_\-init} (const T \&t)
\begin{DoxyCompactList}\small\item\em Take as initialization the value {\ttfamily t}. \item\end{DoxyCompactList}\item 
void \hyperlink{a00026_a138e094daa1a85f345bbdfd852c9fc67}{take\_\-n\_\-times} (unsigned n, const T \&t)
\begin{DoxyCompactList}\small\item\em Take {\ttfamily n} times the value {\ttfamily t}. \item\end{DoxyCompactList}\item 
M \hyperlink{a00118_a963c0beaf5eabf140afb47dac36406d4}{to\_\-result} () const 
\begin{DoxyCompactList}\small\item\em Get the value of the accumulator. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}{\bf }\par
{\em \label{_amgrpd41d8cd98f00b204e9800998ecf8427e}
 }\begin{DoxyCompactItemize}
\item 
void \hyperlink{a00118_a6b6234a159e130fe752141da994241bb}{init} ()
\begin{DoxyCompactList}\small\item\em Manipulators. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}


\subsection{Detailed Description}
\subsubsection*{template$<$typename T, typename S = typename mln::value::props$<$  T  $>$::sum, typename M = S$>$ struct mln::accu::stat::mean$<$ T, S, M $>$}

Generic mean accumulator class. Parameter {\ttfamily T} is the type of values that we sum. Parameter {\ttfamily S} is the type to store the sum of values; the default type of {\ttfamily S} is the summation type (property) of {\ttfamily T}. Parameter {\ttfamily M} is the type of the mean value; the default type of {\ttfamily M} is {\ttfamily S}. 

Definition at line 119 of file accu/stat/mean.hh.



\subsection{Member Function Documentation}
\hypertarget{a00118_a6f640cd2c45cea7827bfc43a1fdc55f3}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!count@{count}}
\index{count@{count}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{count}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename M $>$ {\bf accu::math::count}$<$ T $>$::result {\bf mln::accu::stat::mean}$<$ T, S, M $>$::count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d8/d87/a00118_a6f640cd2c45cea7827bfc43a1fdc55f3}


Get the cardinality. 



Definition at line 242 of file accu/stat/mean.hh.

\hypertarget{a00118_a6b6234a159e130fe752141da994241bb}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!init@{init}}
\index{init@{init}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename M $>$ void {\bf mln::accu::stat::mean}$<$ T, S, M $>$::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d8/d87/a00118_a6b6234a159e130fe752141da994241bb}


Manipulators. 



Definition at line 173 of file accu/stat/mean.hh.

\hypertarget{a00118_af58bf0c7cdb1bfcd7d2e20a8a8643205}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!is\_\-valid@{is\_\-valid}}
\index{is\_\-valid@{is\_\-valid}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{is\_\-valid}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename M $>$ bool {\bf mln::accu::stat::mean}$<$ T, S, M $>$::is\_\-valid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d8/d87/a00118_af58bf0c7cdb1bfcd7d2e20a8a8643205}


Check whether this accu is able to return a result. 

Always true here. 

Definition at line 234 of file accu/stat/mean.hh.

\hypertarget{a00118_a5c53a6ddd8db6a51e77bbf964b80d60a}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!sum@{sum}}
\index{sum@{sum}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{sum}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename M $>$ {\bf accu::math::sum}$<$ T $>$::result {\bf mln::accu::stat::mean}$<$ T, S, M $>$::sum (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d8/d87/a00118_a5c53a6ddd8db6a51e77bbf964b80d60a}


Get the sum of values. 



Definition at line 251 of file accu/stat/mean.hh.

\hypertarget{a00026_a745794a4ef16926d3c09ebbaa8b6b557}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!take\_\-as\_\-init@{take\_\-as\_\-init}}
\index{take\_\-as\_\-init@{take\_\-as\_\-init}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{take\_\-as\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf mean}$<$ T, S, M $>$  $>$::take\_\-as\_\-init (
\begin{DoxyParamCaption}
\item[{const T \&}]{ t}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inherited\mbox{]}}}}
\label{d6/d5b/a00026_a745794a4ef16926d3c09ebbaa8b6b557}


Take as initialization the value {\ttfamily t}. 

Dev note: this is a final method; override if needed by take\_\-as\_\-init\_\- (ending with '\_\-'). \hypertarget{a00026_a138e094daa1a85f345bbdfd852c9fc67}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!take\_\-n\_\-times@{take\_\-n\_\-times}}
\index{take\_\-n\_\-times@{take\_\-n\_\-times}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{take\_\-n\_\-times}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf mean}$<$ T, S, M $>$  $>$::take\_\-n\_\-times (
\begin{DoxyParamCaption}
\item[{unsigned}]{ n, }
\item[{const T \&}]{ t}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inherited\mbox{]}}}}
\label{d6/d5b/a00026_a138e094daa1a85f345bbdfd852c9fc67}


Take {\ttfamily n} times the value {\ttfamily t}. 

Dev note: this is a final method; override if needed by take\_\-as\_\-init\_\- (ending with '\_\-'). \hypertarget{a00118_a963c0beaf5eabf140afb47dac36406d4}{
\index{mln::accu::stat::mean@{mln::accu::stat::mean}!to\_\-result@{to\_\-result}}
\index{to\_\-result@{to\_\-result}!mln::accu::stat::mean@{mln::accu::stat::mean}}
\subsubsection[{to\_\-result}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename M $>$ M {\bf mln::accu::stat::mean}$<$ T, S, M $>$::to\_\-result (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d8/d87/a00118_a963c0beaf5eabf140afb47dac36406d4}


Get the value of the accumulator. 



Definition at line 216 of file accu/stat/mean.hh.

