\hypertarget{a00293}{
\section{mln::morpho::attribute::sum$<$ I, S $>$ Class Template Reference}
\label{d6/d82/a00293}\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
}


Suminality accumulator class.  




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



Inherits base$<$ S, sum$<$ I, S $>$ $>$.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{a00293_a2ef0bb45b64f6cc7a8b1f937e55853b9}{is\_\-valid} () const 
\begin{DoxyCompactList}\small\item\em Check whether this accu is able to return a result. \item\end{DoxyCompactList}\item 
void \hyperlink{a00293_af3c26c18b32751944489d2c31f32f1b4}{set\_\-value} (const argument \&v)
\begin{DoxyCompactList}\small\item\em Set the return value of the accumalator. \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 
S \hyperlink{a00293_a958d2e5be83aec61e90ddfe27b80acea}{to\_\-result} () const 
\begin{DoxyCompactList}\small\item\em Get the value of the accumulator. \item\end{DoxyCompactList}\item 
void \hyperlink{a00293_a21f7ee98d9712b22328a4b1c81df4a82}{untake} (const argument \&v)
\begin{DoxyCompactList}\small\item\em Untake a value from the accumulator. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}{\bf }\par
{\em \label{_amgrpd41d8cd98f00b204e9800998ecf8427e}
 }\begin{DoxyCompactItemize}
\item 
void \hyperlink{a00293_a232c269a2c9de6a55b68d04412b88db7}{init} ()
\begin{DoxyCompactList}\small\item\em Manipulators. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}


\subsection{Detailed Description}
\subsubsection*{template$<$typename I, typename S = typename mln::value::props$<$  typename   I  ::value  $>$::sum$>$ class mln::morpho::attribute::sum$<$ I, S $>$}

Suminality accumulator class. 

Definition at line 80 of file morpho/attribute/sum.hh.



\subsection{Member Function Documentation}
\hypertarget{a00293_a232c269a2c9de6a55b68d04412b88db7}{
\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}!init@{init}}
\index{init@{init}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename I , typename S $>$ void {\bf mln::morpho::attribute::sum}$<$ I, S $>$::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d6/d82/a00293_a232c269a2c9de6a55b68d04412b88db7}


Manipulators. 



Definition at line 137 of file morpho/attribute/sum.hh.



References mln::literal::zero.

\hypertarget{a00293_a2ef0bb45b64f6cc7a8b1f937e55853b9}{
\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}!is\_\-valid@{is\_\-valid}}
\index{is\_\-valid@{is\_\-valid}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{is\_\-valid}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename I , typename S $>$ bool {\bf mln::morpho::attribute::sum}$<$ I, S $>$::is\_\-valid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d6/d82/a00293_a2ef0bb45b64f6cc7a8b1f937e55853b9}


Check whether this accu is able to return a result. 

Return always true. 

Definition at line 229 of file morpho/attribute/sum.hh.

\hypertarget{a00293_af3c26c18b32751944489d2c31f32f1b4}{
\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}!set\_\-value@{set\_\-value}}
\index{set\_\-value@{set\_\-value}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{set\_\-value}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename I , typename S $>$ void {\bf mln::morpho::attribute::sum}$<$ I, S $>$::set\_\-value (
\begin{DoxyParamCaption}
\item[{const argument \&}]{ v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d6/d82/a00293_af3c26c18b32751944489d2c31f32f1b4}


Set the return value of the accumalator. 



Definition at line 205 of file morpho/attribute/sum.hh.

\hypertarget{a00026_a745794a4ef16926d3c09ebbaa8b6b557}{
\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}!take\_\-as\_\-init@{take\_\-as\_\-init}}
\index{take\_\-as\_\-init@{take\_\-as\_\-init}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{take\_\-as\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf sum}$<$ I, S $>$  $>$::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::morpho::attribute::sum@{mln::morpho::attribute::sum}!take\_\-n\_\-times@{take\_\-n\_\-times}}
\index{take\_\-n\_\-times@{take\_\-n\_\-times}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{take\_\-n\_\-times}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf sum}$<$ I, S $>$  $>$::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{a00293_a958d2e5be83aec61e90ddfe27b80acea}{
\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}!to\_\-result@{to\_\-result}}
\index{to\_\-result@{to\_\-result}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{to\_\-result}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename I , typename S $>$ S {\bf mln::morpho::attribute::sum}$<$ I, S $>$::to\_\-result (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d6/d82/a00293_a958d2e5be83aec61e90ddfe27b80acea}


Get the value of the accumulator. 



Definition at line 221 of file morpho/attribute/sum.hh.

\hypertarget{a00293_a21f7ee98d9712b22328a4b1c81df4a82}{
\index{mln::morpho::attribute::sum@{mln::morpho::attribute::sum}!untake@{untake}}
\index{untake@{untake}!mln::morpho::attribute::sum@{mln::morpho::attribute::sum}}
\subsubsection[{untake}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename I , typename S $>$ void {\bf mln::morpho::attribute::sum}$<$ I, S $>$::untake (
\begin{DoxyParamCaption}
\item[{const argument \&}]{ v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d6/d82/a00293_a21f7ee98d9712b22328a4b1c81df4a82}


Untake a value from the accumulator. 



Definition at line 189 of file morpho/attribute/sum.hh.

