\hypertarget{a00056}{
\section{mln::accu::center$<$ P, V $>$ Struct Template Reference}
\label{d9/d2e/a00056}\index{mln::accu::center@{mln::accu::center}}
}


Mass center accumulator.  




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



Inherits base$<$ V, center$<$ P, V $>$ $>$.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{a00056_a10bd37118838137bf533cc6468608ca2}{is\_\-valid} () const 
\begin{DoxyCompactList}\small\item\em Check whether this accu is able to return a result. \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00056_a90b065f1242816cbb328cf6d98180115}{nsites} () const 
\begin{DoxyCompactList}\small\item\em Return the number of sites taken in consideration. \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 
V \hyperlink{a00056_a7871cc240c3ee3231ae991a4a5134323}{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{a00056_ab728b7f009fb09cefbd8e6991121a817}{init} ()
\begin{DoxyCompactList}\small\item\em Manipulators. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}


\subsection{Detailed Description}
\subsubsection*{template$<$typename P, typename V = typename P::vec$>$ struct mln::accu::center$<$ P, V $>$}

Mass center accumulator. 
\begin{DoxyTemplParams}{Template Parameters}
\item[{\em P}]the type of site. \item[{\em V}]the type of vector to be used as result. The default vector type is the one provided by P. \end{DoxyTemplParams}


Definition at line 55 of file center.hh.



\subsection{Member Function Documentation}
\hypertarget{a00056_ab728b7f009fb09cefbd8e6991121a817}{
\index{mln::accu::center@{mln::accu::center}!init@{init}}
\index{init@{init}!mln::accu::center@{mln::accu::center}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename V $>$ void {\bf mln::accu::center}$<$ P, V $>$::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d2e/a00056_ab728b7f009fb09cefbd8e6991121a817}


Manipulators. 



Definition at line 116 of file center.hh.



References mln::literal::zero.

\hypertarget{a00056_a10bd37118838137bf533cc6468608ca2}{
\index{mln::accu::center@{mln::accu::center}!is\_\-valid@{is\_\-valid}}
\index{is\_\-valid@{is\_\-valid}!mln::accu::center@{mln::accu::center}}
\subsubsection[{is\_\-valid}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename V $>$ bool {\bf mln::accu::center}$<$ P, V $>$::is\_\-valid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d2e/a00056_a10bd37118838137bf533cc6468608ca2}


Check whether this accu is able to return a result. 



Definition at line 160 of file center.hh.



Referenced by mln::accu::center$<$ P, V $>$::to\_\-result().

\hypertarget{a00056_a90b065f1242816cbb328cf6d98180115}{
\index{mln::accu::center@{mln::accu::center}!nsites@{nsites}}
\index{nsites@{nsites}!mln::accu::center@{mln::accu::center}}
\subsubsection[{nsites}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename P , typename V $>$ unsigned {\bf mln::accu::center}$<$ P, V $>$::nsites (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d2e/a00056_a90b065f1242816cbb328cf6d98180115}


Return the number of sites taken in consideration. 



Definition at line 168 of file center.hh.

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


Get the value of the accumulator. 



Definition at line 142 of file center.hh.



References mln::accu::center$<$ P, V $>$::is\_\-valid().

