\hypertarget{classKahan}{
\subsection{Kahan Class Reference}
\label{classKahan}\index{Kahan@{Kahan}}
}


Class implementing the \hyperlink{classKahan}{Kahan} summation algorithm to allow accurate summation of very large numbers of doubles.  


\subsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classKahan_a94ba1f89ce6840b254c8dbca86bcf5f6}{Kahan} ()
\item 
void \hyperlink{classKahan_abc01b5a9980b1c9b8bdb11eb2623a2af}{add} (double i)
\end{DoxyCompactItemize}
\subsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
double \hyperlink{classKahan_ac1c6d5b963e3cc83c51677342a54796d}{sum}
\end{DoxyCompactItemize}
\subsubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
double \hyperlink{classKahan_a735657acf745b3949611808ddc79a1a7}{y}
\item 
double \hyperlink{classKahan_a33e60d724081e1341051d89a249d6e1a}{c}
\item 
double \hyperlink{classKahan_ae883c7a48b030df137307cbd1fae7645}{t}
\end{DoxyCompactItemize}


\subsubsection{Detailed Description}
Class implementing the \hyperlink{classKahan}{Kahan} summation algorithm to allow accurate summation of very large numbers of doubles. 

Definition at line 245 of file multispot5.cc.



\subsubsection{Constructor \& Destructor Documentation}
\hypertarget{classKahan_a94ba1f89ce6840b254c8dbca86bcf5f6}{
\index{Kahan@{Kahan}!Kahan@{Kahan}}
\index{Kahan@{Kahan}!Kahan@{Kahan}}
\paragraph[{Kahan}]{\setlength{\rightskip}{0pt plus 5cm}Kahan::Kahan (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classKahan_a94ba1f89ce6840b254c8dbca86bcf5f6}


Definition at line 253 of file multispot5.cc.


\begin{DoxyCode}
        :c(0),sum(0)
        {}
\end{DoxyCode}


\subsubsection{Member Function Documentation}
\hypertarget{classKahan_abc01b5a9980b1c9b8bdb11eb2623a2af}{
\index{Kahan@{Kahan}!add@{add}}
\index{add@{add}!Kahan@{Kahan}}
\paragraph[{add}]{\setlength{\rightskip}{0pt plus 5cm}void Kahan::add (
\begin{DoxyParamCaption}
\item[{double}]{i}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classKahan_abc01b5a9980b1c9b8bdb11eb2623a2af}


Add a number to the running sum. 


\begin{DoxyParams}{Parameters}
{\em i} & Number to add \\
\hline
\end{DoxyParams}


Definition at line 259 of file multispot5.cc.



Referenced by NegativeFreeEnergy::compute\_\-with\_\-mask(), and NegativeFreeEnergy::operator()().


\begin{DoxyCode}
        {
            //y = input -c
            y = i;
            y-= c;

            //t = sum + y
            t = sum;
            t += y;
            
            //c = (t - sum) - y
            //c = ((sum + y) - sum) - y)
            c = t;
            c -= sum;
            c -= y;
            sum = t;
        }
\end{DoxyCode}


\subsubsection{Member Data Documentation}
\hypertarget{classKahan_a735657acf745b3949611808ddc79a1a7}{
\index{Kahan@{Kahan}!y@{y}}
\index{y@{y}!Kahan@{Kahan}}
\paragraph[{y}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf Kahan::y}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classKahan_a735657acf745b3949611808ddc79a1a7}


Input with the compensation removed. Temporary working space. 



Definition at line 247 of file multispot5.cc.

\hypertarget{classKahan_a33e60d724081e1341051d89a249d6e1a}{
\index{Kahan@{Kahan}!c@{c}}
\index{c@{c}!Kahan@{Kahan}}
\paragraph[{c}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf Kahan::c}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classKahan_a33e60d724081e1341051d89a249d6e1a}


Running compenstation for low-\/order bits. 



Definition at line 248 of file multispot5.cc.

\hypertarget{classKahan_ae883c7a48b030df137307cbd1fae7645}{
\index{Kahan@{Kahan}!t@{t}}
\index{t@{t}!Kahan@{Kahan}}
\paragraph[{t}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf Kahan::t}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classKahan_ae883c7a48b030df137307cbd1fae7645}


y + sum, which loses low order bits of y. Temporary working space. 



Definition at line 249 of file multispot5.cc.

\hypertarget{classKahan_ac1c6d5b963e3cc83c51677342a54796d}{
\index{Kahan@{Kahan}!sum@{sum}}
\index{sum@{sum}!Kahan@{Kahan}}
\paragraph[{sum}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf Kahan::sum}}}
\label{classKahan_ac1c6d5b963e3cc83c51677342a54796d}


running sum 



Definition at line 251 of file multispot5.cc.



The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
\hyperlink{multispot5_8cc}{multispot5.cc}\end{DoxyCompactItemize}
