\hypertarget{a00127}{
\section{mln::accu::stat::variance$<$ T, S, R $>$ Struct Template Reference}
\label{df/dcd/a00127}\index{mln::accu::stat::variance@{mln::accu::stat::variance}}
}


Variance accumulator class.  




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



Inherits base$<$ R, variance$<$ T, S, R $>$ $>$.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{a00127_ac3ca89d8eacc2fc7a001639a05596741}{is\_\-valid} () const 
\begin{DoxyCompactList}\small\item\em Check whether this accu is able to return a result. \item\end{DoxyCompactList}\item 
R \hyperlink{a00127_a61fea81d6f09207a23968edb65737fb4}{mean} () const 
\begin{DoxyCompactList}\small\item\em Get the mean value. \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00127_aa89d608883ee40faf07853b6a885bf72}{n\_\-items} () const 
\begin{DoxyCompactList}\small\item\em Get the number of items. \item\end{DoxyCompactList}\item 
R \hyperlink{a00127_a73b730391d68efd18d569262092dde94}{standard\_\-deviation} () const 
\begin{DoxyCompactList}\small\item\em Get the standard deviation value. \item\end{DoxyCompactList}\item 
S \hyperlink{a00127_a49ef9fabaca32cdc61c2d33506048820}{sum} () const 
\begin{DoxyCompactList}\small\item\em Get the sum value. \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 
R \hyperlink{a00127_a4a31927e506b7081dc2cb1e797269b73}{to\_\-result} () const 
\begin{DoxyCompactList}\small\item\em Get the accumulator result (the variance value). \item\end{DoxyCompactList}\item 
R \hyperlink{a00127_a7c043bcb18c524f0af9b7055f39fc03b}{var} () const 
\begin{DoxyCompactList}\small\item\em Get the variance value. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}{\bf }\par
{\em \label{_amgrpd41d8cd98f00b204e9800998ecf8427e}
 }\begin{DoxyCompactItemize}
\item 
void \hyperlink{a00127_ac6267d20616ea67b6475cdcc20b1037d}{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 R = S$>$ struct mln::accu::stat::variance$<$ T, S, R $>$}

Variance accumulator class. Parameter {\ttfamily T} is the type of values that we sum. Parameter {\ttfamily S} is the type to store the value sum and the sum of value $\ast$ value; the default type of {\ttfamily S} is the summation type (property) of {\ttfamily T}. Parameter {\ttfamily R} is the type of the mean and variance values; the default type of {\ttfamily R} is {\ttfamily S}. 

Definition at line 61 of file variance.hh.



\subsection{Member Function Documentation}
\hypertarget{a00127_ac6267d20616ea67b6475cdcc20b1037d}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!init@{init}}
\index{init@{init}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ void {\bf mln::accu::stat::variance}$<$ T, S, R $>$::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_ac6267d20616ea67b6475cdcc20b1037d}


Manipulators. 



Definition at line 125 of file variance.hh.



References mln::literal::zero.

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


Check whether this accu is able to return a result. 

Always true here. 

Definition at line 229 of file variance.hh.

\hypertarget{a00127_a61fea81d6f09207a23968edb65737fb4}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!mean@{mean}}
\index{mean@{mean}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{mean}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ R {\bf mln::accu::stat::variance}$<$ T, S, R $>$::{\bf mean} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_a61fea81d6f09207a23968edb65737fb4}


Get the mean value. 



Definition at line 187 of file variance.hh.



References mln::literal::zero.

\hypertarget{a00127_aa89d608883ee40faf07853b6a885bf72}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!n\_\-items@{n\_\-items}}
\index{n\_\-items@{n\_\-items}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{n\_\-items}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ unsigned {\bf mln::accu::stat::variance}$<$ T, S, R $>$::n\_\-items (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_aa89d608883ee40faf07853b6a885bf72}


Get the number of items. 



Definition at line 205 of file variance.hh.

\hypertarget{a00127_a73b730391d68efd18d569262092dde94}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!standard\_\-deviation@{standard\_\-deviation}}
\index{standard\_\-deviation@{standard\_\-deviation}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{standard\_\-deviation}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ R {\bf mln::accu::stat::variance}$<$ T, S, R $>$::standard\_\-deviation (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_a73b730391d68efd18d569262092dde94}


Get the standard deviation value. 



Definition at line 221 of file variance.hh.



References mln::accu::stat::variance$<$ T, S, R $>$::to\_\-result().

\hypertarget{a00127_a49ef9fabaca32cdc61c2d33506048820}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!sum@{sum}}
\index{sum@{sum}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{sum}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ S {\bf mln::accu::stat::variance}$<$ T, S, R $>$::sum (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_a49ef9fabaca32cdc61c2d33506048820}


Get the sum value. 



Definition at line 197 of file variance.hh.

\hypertarget{a00026_a745794a4ef16926d3c09ebbaa8b6b557}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!take\_\-as\_\-init@{take\_\-as\_\-init}}
\index{take\_\-as\_\-init@{take\_\-as\_\-init}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{take\_\-as\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf variance}$<$ T, S, R $>$  $>$::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::variance@{mln::accu::stat::variance}!take\_\-n\_\-times@{take\_\-n\_\-times}}
\index{take\_\-n\_\-times@{take\_\-n\_\-times}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{take\_\-n\_\-times}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf variance}$<$ T, S, R $>$  $>$::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{a00127_a4a31927e506b7081dc2cb1e797269b73}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!to\_\-result@{to\_\-result}}
\index{to\_\-result@{to\_\-result}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{to\_\-result}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ R {\bf mln::accu::stat::variance}$<$ T, S, R $>$::to\_\-result (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_a4a31927e506b7081dc2cb1e797269b73}


Get the accumulator result (the variance value). 



Definition at line 176 of file variance.hh.



Referenced by mln::accu::stat::variance$<$ T, S, R $>$::standard\_\-deviation(), and mln::accu::stat::variance$<$ T, S, R $>$::var().

\hypertarget{a00127_a7c043bcb18c524f0af9b7055f39fc03b}{
\index{mln::accu::stat::variance@{mln::accu::stat::variance}!var@{var}}
\index{var@{var}!mln::accu::stat::variance@{mln::accu::stat::variance}}
\subsubsection[{var}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename S , typename R $>$ R {\bf mln::accu::stat::variance}$<$ T, S, R $>$::{\bf var} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{df/dcd/a00127_a7c043bcb18c524f0af9b7055f39fc03b}


Get the variance value. 



Definition at line 213 of file variance.hh.



References mln::accu::stat::variance$<$ T, S, R $>$::to\_\-result().

