\doxysection{Moments.\+hpp}
\hypertarget{Moments_8hpp_source}{}\label{Moments_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Math/Moments.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Math/Moments.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_MATH\_STATS\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_MATH\_STATS\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}Defs.hpp"{}}}
\DoxyCodeLine{00005\ }
\DoxyCodeLine{00006\ \textcolor{keyword}{namespace\ }math\ \{}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structmath_1_1Moments}{Moments}}}
\DoxyCodeLine{00009\ \{}
\DoxyCodeLine{00010\ \ \ \ \ \textcolor{keywordtype}{float}\ m1\{0.0f\};}
\DoxyCodeLine{00011\ \ \ \ \ \textcolor{keywordtype}{float}\ m2\{0.0f\};}
\DoxyCodeLine{00012\ \ \ \ \ uint\ N\{0\};}
\DoxyCodeLine{00013\ }
\DoxyCodeLine{00014\ \ \ \ \ \mbox{\hyperlink{structmath_1_1Moments}{Moments}}\&\ operator+=(\textcolor{keywordtype}{float}\ v)}
\DoxyCodeLine{00015\ \ \ \ \ \{}
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ m1o\ =\ m1;}
\DoxyCodeLine{00017\ \ \ \ \ \ \ \ \ N\ \ +=\ 1;}
\DoxyCodeLine{00018\ \ \ \ \ \ \ \ \ m1\ +=\ (v\ -\/\ m1)\ /\ N;}
\DoxyCodeLine{00019\ \ \ \ \ \ \ \ \ m2\ +=\ (v\ -\/\ m1)\ *\ (v\ -\/\ m1o);}
\DoxyCodeLine{00020\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00021\ \ \ \ \ \}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \ \ \ \ \mbox{\hyperlink{structmath_1_1Moments}{Moments}}\&\ operator+=(\textcolor{keyword}{const}\ \mbox{\hyperlink{structmath_1_1Moments}{Moments}}\ \&A)}
\DoxyCodeLine{00024\ \ \ \ \ \{}
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ uint64\_t\ No\ =\ N;}
\DoxyCodeLine{00026\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ D\ =\ m1\ -\/\ A.m1;}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ N\ \ +=\ A.N;}
\DoxyCodeLine{00028\ \ \ \ \ \ \ \ \ m1\ +=\ (A.m1\ -\/\ m1)\ *\ A.N\ /\ \textcolor{keywordtype}{float}(N);}
\DoxyCodeLine{00029\ \ \ \ \ \ \ \ \ m2\ +=\ A.m2\ +\ float(No\ *\ A.N)\ /\ N\ *\ (D\ *\ D);}
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00031\ \ \ \ \ \}}
\DoxyCodeLine{00032\ \};}
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00034\ \}\ \textcolor{comment}{//\ namespace\ math}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_MATH\_STATS\_H}}

\end{DoxyCode}
